from django.db import models
from django.contrib.auth.models import AbstractUser, Group, Permission

class MyUser(AbstractUser):
    first_name = None
    last_name = None
    #Uid = models.AutoField(primary_key=True)
    email = models.CharField(max_length=255)
    avatar = models.CharField(max_length=255)
    groups = models.ManyToManyField(
        Group,
        related_name='myuser_groups',  # 设置反向关系名称
        blank=True,
    )

    user_permissions = models.ManyToManyField(
        Permission,
        related_name='myuser_permissions',  # 设置反向关系名称
        blank=True,
    )
    USERNAME_FIELD = 'username'
    class Meta:
        db_table = 'user_info' 